<html>
<head>
<script type = "text/javascript">
function confirmation(){
	return confirm("are you sure");
}
</script>







<link rel = "stylesheet" type = "text/css" href = "newguestcss.css"/>

<script type="text/javascript" src="guest.js"></script>



<script type = "text/javascript">
var remote = null;
window.name = "content";
function openRemote(contentURL,windowName,x,y){
	widthHeight = 'height = '+ y +'width='+x;
	if (remote) remote.focus();
	else var remote = window.open(contentURL,windowName,widthHeight);
	}
function stripHTML(){
var re= /<\S[^><]*>/g
for (i=0; i<arguments.length; i++)
arguments[i].value=arguments[i].value.replace(re, "")
}
	
	
	
	function greet(){
		alert("welcome to admin page")
		}
	
	function delete(){
		return confirm("welcome to admin page")
		}
	
	
	
	
	
	</script>












</head>

<body  onLoad ='greet()' >

	

<table cellspacing="10">
<tr>
	<td class = "td1">
		<div>
			
			<h4 style = "color:black">ADMIN PAGE</h4>
			


		</div>
		
		
		
	</td>
</tr>
</table>

<table cellspacing="10">
	<tr valign = "top">
		<td class = "td2">
		
		<div  onclick = "openRemote('remote.html','remote',150,300)">
		
			<h5 style = "border:1px dotted blue;padding:10px 10px "><a href = "javascript:openRemote('remote.html','remote',400,300)"><img width = '50' src = 'remote/remote1.png'/>REMOTE</a></h5>
		
		
		
		</div>
		
			<a href = "Profile.php" >Home</a><hr/>
			<a href = "newGuestBook.php" >Comment</a><br/><hr/>
			<a href = "newGuestBook.php" >View comment</a><br/><hr/>
			<a href = "Profile.php" >Author</a><br/><hr/>
			
	
	
		</td>
		<td class = "td3">
		
		
		
		<div>
		
<?php

$database = "test";
$conn = mysql_connect("localhost","root","" );
if( $conn === FALSE ){
    die("Connection failed.");
} else {
    
    mysql_select_db( $database );
    $sql = "SELECT * FROM guestbook";
    $result = mysql_query( $sql );
    if($result === FALSE){
        die("Invalid Query.");
    } else {
        echo "<table border='1'>";
        while( $row = mysql_fetch_assoc( $result ) ){
		
		echo"<form method = 'post' action = 'Approved.php' onSubmit='stripHTML(this.name,this.email,this.comment,this.datetime)'>";
            echo "<tr>";
            echo "<td>" . $row["id"] . "</td>";
            echo "<td><input type = 'text'size = '10' name = 'aname' value = " . $row["name"] . "></td>";
            echo "<td><input type = 'text'size = '10' name = 'email' value = " . $row["email"] . "></td>";
            echo "<td><input type = 'text'size = '10' name = 'comment' value = " . $row["comment"] . "></td>";
            echo "<td><input type = 'text'size = '10' name = 'datetime' value = " . $row["datetime"] . "></td>";
            echo"<td><input type ='submit' value = 'approved'/></td>";
			echo "<td><a onCslick ='return delete()'href = 'delete.php?id={$row['id']}'>DELETE</a></td>";
        echo "</tr>";
      
        }
        echo "</table>";
		echo"</form>";
    }
}
?>

			
			
			
			
		
				
		
		</div>
		
		</td>
		<td class = "td4">
		<dl class="dropdown"> 
				
					<dt id="one-ddheader" onmouseover="ddMenu('one',1)" onmouseout="ddMenu('one',-1)">
					<h4>Participating Sites</h4>
					
					</dt> 
					  <dd id="one-ddcontent" onmouseover="cancelHide('one')" onmouseout="ddMenu('one',-1)"> 
						<a href= "www.google.com"><img width = '40' class = "bimg" src = "PNG/Chrome.png"/></a><br/>
						
						<a href= "guestbook.php"><img width = '40' class = "bimg" src = "PNG/Yahoo.png"/></a><br/>
						<a href= "guestbook.php"><img width = '40'  class = "bimg"src = "PNG/Twitter.png"/></a><br/>
						<a href= "guestbook.php"><img width = '40'  class = "bimg"src = "PNG/Youtube.png"/></a><br/>
						
						
					
					 </dd> 
					</dl> 		
		
		
		
		
		</td>
	</tr>
	





</table>
<table width="100%"  border="0" cellpadding="15" cellspacing="0" class="footer">  
<tr>   
<td align='center'>ADD St. Brgy. Sampaloc, Apalit, Pampanga. Tel. (045) 879-1536
<br /> 
&copy; 2010 Copyright. La Verdad Christian College. All rights reserved.
</td>  
<td valign="bottom"></td>  
</tr>
</table>
	


</body>

	


</html>
